import React, { Component } from 'react';
import { createPage, base, ajax, toast } from 'nc-lightapp-front';
import SearchPage from '../../pages/search';

const { NCButton, NCModal } = base;

class Modal extends Component {
    constructor(props) {
        super(props);
        this.state = {
            visible: false
        };
    }

    show(flag) {
        this.setState({
            visible: true
        });
    }

    hide() {
        this.setState({
            visible: false
        });
    }

    render() {
        return (
            <NCModal size='xlg' backdrop={true} show={this.state.visible} onHide={this.hide.bind(this)}>
                <NCModal.Header closeButton={true}>
                    <NCModal.Title>{this.props.multilang['modal_search_title']}</NCModal.Title>
                </NCModal.Header>
                <NCModal.Body>
                    <SearchPage multilang={this.props.multilang} />
                </NCModal.Body>
            </NCModal>
        );
    }
}

export default Modal;
